Guild icon
Project Sekai
🔒 UMDCTF 2023 / ✅-rev-introduction-to-c
Avatar
Introduction to C - 500 points
Category: Rev Description: "Welcome to CMSC216. Weeeeee have a lecture worksheet that the TAs will now hand out. You must write your name, student ID, and discussion session CORRECTLY at the top of the worksheet. I have 369 students, so any time I need to spend finding out who to grade will cause YOU to lose credit." (Larry Herman) Author: Assgent Files:Tags: No tags.
Sutx pinned a message to this channel. 04/28/2023 3:00 PM
Avatar
@Violin wants to collaborate 🤝
Avatar
@Legoclones wants to collaborate 🤝
Avatar
The picture looks like this
16:32
and the text file has 128 keys with RGB values
16:32
almost seems a little steggy 🤔
16:34
32x32 pixels, 1024 total
Avatar
@Iyed wants to collaborate 🤝
Avatar
@Iyed but like when is another mach-o
🤣 1
Avatar
I actually don't know lot about it xD
16:38
this challenge seems so guessy
16:38
I'm trying to patch the counter strike one
16:38
I don't have the game
Avatar
it's steg what can we expect \o/
Avatar
Avatar
Iyed
I actually don't know lot about it xD
oh okay I didn't know if u had a mac and that helped u with last one
Avatar
but I'm trying to make it pass checks and print dimensions so I can draw flag with python
👍 1
Avatar
Avatar
Legoclones
oh okay I didn't know if u had a mac and that helped u with last one
nah just looked at code and made a little guesses
👍 1
Avatar
Okay, general observations for this chall:
  • Last 13 pixels on bottom row are all white (assuming those aren't needed?)
  • 0x40c0e0 (light blue) is everywhere, and some places have it up to 7 times in a row
  • 0xa8980c (mustard yellow) is also common, and often followed by 0x4c942a (green)
(edited)
16:42
since 1024 pixels, if each pixel is 0/1, that means we can get 128 chars
16:43
Also rows 4-22 have very similar colors, lines 0-4 and 23+ look weirder
16:44
Hmm the light blue that is common (0x40c0e0) is the same as key 32
16:45
ohhhhh
16:45
32 is 0x20, which is a space - maybe each pixel is a letter, and you have to match the color to the key, and the key number is the hex value
16:46
So a value with light blue 0x40c0e0 corresponds to key 32, which in ASCII is a space
Avatar
ohhh interesting
16:47
so we just have to write a script to parse image and correspond each color to it's char
Avatar
yeah
16:50
hhahahaha
16:50
#include <stdio.h> #define LEN(array) sizeof(array) / sizeof(*array) #define SALT_1 97 #define SALT_2 4563246763 const long numbers[] = {4563246815, 4563246807, 4563246800, 4563246797, 4563246816, 4563246802, 4563246789, \ 4563246780, 4563246783, 4563246850, 4563246843, 4563246771, 4563246765, 4563246825, 4563246781, 4563246784, \ 4563246796, 4563246784, 4563246843, 4563246765, 4563246825, 4563246786, 4563246844, 4563246803, 4563246800, \ 4563246825, 4563246775, 4563246852, 4563246843, 4563246778, 4563246825, 4563246781, 4563246849, 4563246782, \ 4563246843, 4563246778, 4563246769, 4563246825, 4563246796, 4563246782, 4563246769, 4563246781, 4563246821, \ 4563246823, 4563246827, 4563246827, 4563246827, 4563246791}; int main(void) { size_t i; char undecyphered_char; for (i = 0; i < LEN(numbers); i++) { undecyphered_char = (char)((numbers[i] - SALT_2) ^ 97); printf("%c", undecyphered_char); } printf("\n"); return 0; }
16:50
That's the code it gives
16:50
I was right
16:50
now for step 2
Avatar
Avatar
Legoclones
used /ctf submit
✅ Well done, challenge solved!
Avatar
Easy
16:51
just run
16:51
and it prints flag
16:51
UMDCTF{pu61ic_st@t1c_v0ID_m81n_s7r1ng_@rgs[]!!!}
🔥 1
Avatar
nice gg
Avatar
nice
Exported 40 message(s)